import { createRouter, createWebHistory } from 'vue-router'
import Login from '@/components/login/Login.vue'
import Admin from '@/components/main/Admin.vue'
import CoachInfo from "@/components/coach/CoachInfo";
import StudentInfo from "@/components/student/StudentInfo";
import StudentProgress from "@/components/student/StudentProgress";
import CoachPerformance from "@/components/coach/CoachPerformance";
import DriveDetail from "@/components/drive/DriveDetail";
import Audit from "@/components/audit/Audit";
import ChangePassword from "@/components/audit/ChangePassword";
import PersonalInfo from "@/components/audit/PersonalInfo";
import Material from "@/components/material/Material";
import Check from "@/components/material/Check";
import Register from "@/components/material/Register";
import Car from "@/components/car/Car";
import StudentAllocation from "@/components/audit/StudentAllocation";

const routes = [
    {
        path: '/',
        name: 'Login',
        component: Login,
    },
    {
        path: '/admin',
        name: 'Admin',
        component: Admin,
        children: [
            {
                path: '/coachInfo',
                name: 'CoachInfo',
                component: CoachInfo,
            },
            {
                path:'/studentInfo',
                name:'StudentInfo',
                component: StudentInfo,
            },
            {
                path: '/studentProgress',
                name: 'StudentProgress',
                component: StudentProgress,
            },
            {
                path: '/coachPerformance',
                name: 'CoachPerformance',
                component: CoachPerformance,
            },
            {
                path :'/driveDetail',
                name: 'DriveDetail',
                component: DriveDetail,
            },
            {
                path: '/car',
                name: 'Car',
                component: Car,
            },
            // 其他子页面路由 (如果需要)
        ],
    },
    {
        path : '/audit',
        name: 'Audit',
        component: Audit,
        children: [
            {
                path:'/changePassword',
                name: 'ChangePassword',
                component: ChangePassword,
            },
            {
                path:'./personalInfo',
                name:'PersonalInfo',
                component: PersonalInfo,
            },
            {
                path :'./material',
                name : 'Material',
                component: Material,
            },
            {
                path :'./check',
                name :'Check',
                component: Check,
            },
            {
                path :'./register',
                name: 'Register',
                component: Register,
            },
            {
                path: './studentAllocation',
                name: 'StudentAllocation',
                component: StudentAllocation,
            },
        ],
    },
]

const router = createRouter({
    history: createWebHistory(process.env.BASE_URL),
    routes,
})

export default router